﻿using System;
using System.Dynamic;

namespace JESAI.Application.Abstractions.Admin.Dtos.User
{
    public class QueryUserDto
    {
        /// <summary>
        /// udcid 
        /// </summary>
        public long Id { set; get; }
        /// <summary>
        /// 用户账号
        /// </summary>
        public string UserName { set; get; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { set; get; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile { set; get; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { set; get; }
        /// <summary>
        /// 账户状态
        /// </summary>
        public int State { set; get; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { set; get; }
        /// <summary>
        /// 用户角色
        /// </summary>
        public List<RoleListDto> RoleList { set; get; } = new List<RoleListDto>();

        /// <summary>
        /// 用户角色ID列表
        /// </summary>
        public int[] RoleIdList { get { return RoleList.Select(r => r.Id).ToArray(); } }
    }

    public class RoleListDto
    {
        public int Id { set; get; }
        public string Name { set; get; }
        public string ProjectName { set; get; }
        public long Uid { set; get; }

        /// <summary>
        /// 部门ID
        /// </summary>
        public string DepartmentId { set; get; }

    }
}
